<template>
    <view class="list-cell">
        <slot></slot>
    </view>
</template>

<script>
    import { getRect } from '../../libs/util/tools.js';
    export default {
        props: {
            itemData: {
                type: [Object, Array, Number, String],
                default: ''
            }
        },
        watch: {
            itemData: {
                deep: true,
                handler(){
                    this.$nextTick(this.updateSize)
                }
            }
        },
        mounted() {
            this.updateSize()
        },
        methods: {
            updateSize(){
                getRect('.list-cell', this).then(res => {
                    this.$emit('updateSize', {height: res.height})
                })
            }
        }
    }
</script>

<style>
</style>